<div class="box-body" style="display: block;">
    <form id="store-form" method="POST" action="/xqc/file/store-file-upload" class="form-horizontal" accept-charset="UTF-8" enctype="multipart/form-data">
        <div class="box-body fields-group">
            <div class="form-group">
                <label class="col-sm-3 control-label"></label>
                <div class="col-sm-5">
                    <label style="padding-top: 8px;" for="file_type_1" class="col-sm-3 control-label">类型</label>
                    <div class="col-sm-8">
                        <select id="file_type_1" name="param[file_type]" required>
                            {{ getOptions(\App\Models\File\FileStore::$_fileTypeForArea) }}
                        </select>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label"></label>
                <div class="col-sm-5">
                    <label style="padding-top: 8px;" for="area_id_1" class="col-sm-3 control-label">站点</label>
                    <div class="col-sm-8">
                        <select id="area_id_1" name="param[area_id]" required>
                            {{ getOptions(\App\Models\Basics\AmazonArea::options()) }}
                        </select>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label"></label>
                <div class="col-sm-5">
                    <label style="padding-top: 8px;" for="file_date" class="col-sm-3 control-label">日期</label>
                    <div class="col-sm-8">
                        <input style="margin-top: 4px;" type="text" id="file_date" name="param[file_date]" placeholder="选择日期" required>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label"></label>
                <div class="col-sm-5">
                    <label style="padding-top: 8px;" class="col-sm-3 control-label">文件</label>
                    <div class="col-sm-8">
                        <input type="file" style="margin-top: 4px;" name="source_file[]" multiple="multiple"  accept=".csv,.xlsx,.xls" required>
                        <span class="help-block"><i class="fa fa-info-circle"></i>&nbsp;文件后缀为.csv、.xlsx或.xls</span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-10" style="margin-left: 25%">
                    <span style="color:red;">
                        <div>注：上传文件不要超过20个，单个文件不要超过1M，批量上传需确保同一地区。</div>
                        <div>其中FBAInventory类型仅限于欧洲站按站点导入，其他站点请按国家导入</div>
                        <div>建议文件命名时加入年月日区分（例：xxx202001.csv）</div>
                    </span>
                </div>
            </div>
        </div>
        <div class="box-footer">
            <div class="col-md-3"></div>
            <div class="col-md-5" style="text-align: center;">
                <div class="btn-group">
                    {{ csrf_field() }}
                    <input type="hidden" name="action" value="Area">
                    <button type="submit" class="btn btn-info">提交</button>
                </div>
            </div>
        </div>
    </form>
</div>
<script language="JavaScript" type="text/javascript">
    $(function () {
        $('#file_date').datetimepicker({"format":"YYYY-MM-01","locale":"zh-CN",defaultDate: new Date(new Date().getFullYear(), new Date().getMonth()-1),"allowInputToggle":true});
        $('#area_id_1').select2({placeholder: '站点', allowClear: true, width: '147px'});
        $('#file_type_1').select2({placeholder: '类型', allowClear: true, width: '148px'});
        $("#store-form").ajaxForm(function (data) {
            if (typeof data === 'object') {
                if (data.status) {
                    toastr.success('提交成功！');
                } else {
                    swal(data.message, '', 'error');
                }
            }
        });
    });
</script>
